<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Source: address/address.js</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Source: address/address.js</h1>

    



    
    <section>
        <article>
            <pre class="prettyprint source linenums"><code>import fetch from '@/utils/request';

const API_ADDRESS_URL = '/api/user/receiver';
/**
 * 地址API对象
 * @module AddressApi
 */
const AddressApi = {
	/**
	 * @function query
	 * @description 查询地址
	 * @param  {Object} query 查询参数对象
	 * @param  {Object} param 分页参数对象
	 */
	query: (query, param) => fetch.request({
		url: `${API_ADDRESS_URL}/query`,
		method: 'POST',
		data: {
			query: query,
			param: param
		},
	}),
	/**
	 * @function save
	 * @description 添加地址
	 * @param  {Object} address 地址对象
	 */
	save: (address) => fetch.request({
		url: `${API_ADDRESS_URL}/save`,
		method: 'POST',
		data: {
			receiver: address,
		},
	}),
	/**
	 * @function delete
	 * @description 删除地址
	 * @param  {String} id 地址对象id
	 */
	delete: (id) => fetch.request({
		url: `${API_ADDRESS_URL}/delete`,
		method: 'POST',
		data: {
			id: id,
		},
	}),
	/**
	 * @function get
	 * @description 得到地址
	 * @param  {String} id 地址对象id
	 */
	get: (id) => fetch.request({
		url: `${API_ADDRESS_URL}/get?id=${id}`,
		method: 'GET',
	}),
	/**
	 * @function get_def
	 * @description 得到默认地址
	 */
	get_def: () => fetch.request({
		url: `${API_ADDRESS_URL}/def`,
		method: 'GET',
	}),
	/**
	 * @function set_def
	 * @description 设置默认地址
	 * @param  {String} id 地址对象id
	 */
	set_def: (id) => fetch.request({
		url: `${API_ADDRESS_URL}/def`,
		method: 'POST',
		data: {
			id: id,
		},
	}),
};
export default AddressApi;</code></pre>
        </article>
    </section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-AddressApi.html">AddressApi</a></li><li><a href="module-CategoryApi.html">CategoryApi</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Mon Apr 24 2023 21:07:58 GMT+0800 (中国标准时间)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>
